package com.chinatgl.latte.ec.main.sort.content;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chinatgl.latte.app.Latte;
import com.chinatgl.latte.ec.R;

import java.util.List;

/**
 * Created by 傅令杰
 */

public class SectionAdapter extends BaseQuickAdapter<SectionBeanDetail.ChildBrandsBean> {
    public SectionAdapter(int layoutResId, List<SectionBeanDetail.ChildBrandsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, SectionBeanDetail.ChildBrandsBean sectionBeanDetail) {
        baseViewHolder.setText(R.id.text, sectionBeanDetail.getName());
        ImageView image = baseViewHolder.getView(R.id.image_brand);
        Glide.with(Latte.getApplication())
                .load(sectionBeanDetail.getImage() + "?imageView2/q/50")
                .crossFade()
                .placeholder(R.mipmap.img_zhanwei_dianpu)
                .into(image);
    }
}
